package school.valon.persistence.pojo;

import java.io.Serializable;

import javax.persistence.*;

/**
 * The persistent class for the student database table.
 * 
 */
@Entity
@Table(name="school")
@NamedQueries({
@NamedQuery(name="School.findAll", query="SELECT s FROM School s"),
@NamedQuery(name="School.deleteById", query="DELETE FROM School WHERE schoolId = :P1")
})
public class School implements Serializable {

	private static final long serialVersionUID = 6151579949268187214L;

	@Id
	@Column(name="school_id")
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Integer schoolId;

	@Column(name="school_name")
	private String schoolName;

	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="address_id", referencedColumnName="address_id")
	private Address address;

	public Integer getSchoolId() {
		return schoolId;
	}

	public void setSchoolId(Integer schoolId) {
		this.schoolId = schoolId;
	}

	public String getSchoolName() {
		return schoolName;
	}

	public void setSchoolName(String schoolName) {
		this.schoolName = schoolName;
	}

	public Address getAddress() {
		return address;
	}

	public void setAddress(Address address) {
		this.address = address;
	}
}